﻿namespace Control;

public partial class MainPage : ContentPage {
    int count = 0;

    public MainPage() {
        // ChildAdded += MainPage_ChildAdded;

        InitializeComponent();
        
        ClickMeButton.SendClicked();

        var button = new Button {
            Text = "Click Me!",
            HeightRequest = 100,
            Margin = new Thickness(16, 16, 16, 16),
            BackgroundColor = Colors.DarkRed,
            HorizontalOptions = LayoutOptions.Center
        };
        
        MainStackLayout.Add(button);
    }

    private void MainPage_ChildAdded(object sender, ElementEventArgs e) =>
        DisplayAlert("Message", "Element added.", "OK");

    private void ClickMeButton_OnClicked(object sender, EventArgs e) =>
        DisplayAlert("Message", "You clicked the button.", "OK");
}